This page last changed on Apr 28, 2006 by rossmason.
The tcp connector can be used to send and receive mule events over tcp.
The javadoc for this transport provider can be found here. And the Source Xref can be found here
Tcp Connector Properties
Property |
Description |
Default |
Required |
receiveTimeout |
The socket read timeout. Use either this or a dedicated send/receive timeout property. |
Socket Default |
No |
sendTimeout |
The socket write timeout. Use either this or a dedicated send/receive timeout property. |
Socket Default |
No |
timeout |
This is a shorthand property setting both read/write timeouts. Use either this or a dedicated send/receive timeout property. |
Socket Default |
No |
bufferSize |
the buffer size used to read and write data |
Socket Default |
No |
backlog |
Maximum Queue length for a ServerSocket. Only applies to inbound connections. |
ServerSocket Default |
No |
tcpProtocol |
An implementation of TcpProtocol interface |
|
No |
tcpProtocolClassName |
The class name of the TcpProtocol interface. Only applies to inbound connections. |
org.mule.providers.tcp.protocols.DefaultProtocol |
No |
keepSendSocketOpen |
Whether to keep the socket open for multiple dispatches. Only applies to outbound connections. |
false |
No |
keepAlive |
Whether to keep server sockets open after a request has been processed. This will set keepAlive on the socket. Only applies to inbound connections. |
false |
No |
maxRetryCount |
Removed: A Connection Strategy should be used to manage connection retry behaviour o n the connector. |
- |
- |
Endpoints
Tcp endpoints are described as socket-based endpoints in the form of -
Transformers
The following transformers are used by default for this connector unless a transformer is explicitly set on the provider.
Transformer |
Description |
ByteArrayToString |
converts a byte array to a String |
StringToByteArray |
Converts a String to a byte array |
Protocols
When transfering data with other applications, it may be necessary to use custom application level protocols. This is also useful when transfering large amount of datas so that the whole data is not split.
This protocol is handled with the TcpProtocol interface.
If your protocol implementation does not need configuration, you can use
<connector name="tcpConnector" className="org.mule.providers.tcp.TcpConnector">
<properties>
<property name="tcpProtocolClassName" value="org.mule.providers.tcp.protocols.LengthProtocol"/>
</properties>
</connector>
or you can use a bean from a container
<connector name="tcpConnector" className="org.mule.providers.tcp.TcpConnector">
<properties>
<container-property name="tcpProtocol" reference="myProtocol"/>
</properties>
</connector>
Protocol |
Description |
org.mule.providers.tcp.protocols.DefaultProtocol |
reads data until no more is available |
org.mule.providers.tcp.protocols.LengthProtocol |
reads an int specifying the data length, and then reads the specified number of bytes |
org.mule.providers.tcp.protocols.EOFProtocol |
reads all data until the stream is closed |
|